# coding:utf-8

import pandas as pd

raw_data = pd.read_excel("缺失值数据示例.xlsx")

print(raw_data)
print("-----------")
print(raw_data.isnull())
print("-----------")
new_data = raw_data.copy()
new_data.dropna(subset=["身高"], inplace=True)
# mean,median,mode
new_data.fillna(value={"体重":new_data["体重"].median()}, inplace=True)
new_data.fillna(value={"是否色盲":new_data["是否色盲"].mode()[0]}, inplace=True)
print(new_data)
